<%@ page language="java" import="java.util.*,cn.sypt.yuhao.domain.*"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!--header-->
<%
	User ub = (User) session.getAttribute("user");
%>
<!-- 搜索 -->
<link rel="stylesheet" href="../css/jquery.bigautocomplete.css"
	type="text/css" />

<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../js/jquery.bigautocomplete.js"></script>
<script type="text/javascript">
	$(function() {
		$("#search").bind('input propertychange', function() {
			var spname=$("#search").val()
		//	alert(spname);
			$.ajax({
				type : "POST",
				url : "/sypt/VideoServlet",
				async : false,
				dataType : "json",
				data : {
					"method" : "tip",
					"spname": spname
				},
				success : function(list) {
			$("#search").bigAutocomplete({
				
				data:list
			});
			
				}
			});
			
		});
		

	})
</script>
<!-- 搜索 -->
<script type="text/javascript">
	function search1() {
		//alert("jjisaojfoij");
		var value = $("#search").val();
		//	var flag=false;
		//alert(value);
		if (value.trim() == "" || value == "Search") {
			alert("请输入需要搜索的内容");
			return false;
		} else {

			return true;
		}
	}
</script>
<div class="header">
	<div class="header-top">
		<div class="container">
			<div class="search">
				<form action="<c:url value='/VideoServlet?method=search'/>"
					method="post">
					<input type="text" id="search" name="spname" value="Search"
						onFocus="this.value = '';"
						onBlur="if (this.value == '') {this.value = 'Search';}"> <input
						type="submit" onclick="return search1();" value="Go">
				</form>
			</div>
			<div class="header-left">
				<ul>
					<%
						if (ub == null) {
					%>
					<li><a href="login.jsp">登录</a></li>
					<li><a href="zhuce.jsp">注册</a></li>

					<%
						} else {
					%>
					<li><a href="javascript:void(0);">尊敬的用户:<%=ub.getUname()%></a></li>
					<li><a href="<c:url value='/UserServlet?method=logout'/>">注销</a></li>
					<li><a href="<c:url value='/home/pshp.jsp'/>">个人管理中心</a></li>
					<%
						}
					%>
				</ul>

				<div class="clearfix"></div>
			</div>
			<div class="clearfix"></div>
		</div>
	</div>
	<div class="container">
		<div class="head-top">
			<div class="logo">
				<a href="/sypt/index.jsp"><img src="images/logo.gif" alt=""></a>
			</div>
			<div class=" h_menu4">
				<ul class="memenu skyblue">
					<li class="active grid"><a class="color8"
						href="<c:url value='/CategoryServlet?method=findAll'/>">首页</a></li>
					<c:forEach items="${sessionScope.list }" var="head">
						<li><a class="color1"
							href="<c:url value='/AcategoryServlet?method=findByfid&fid=${head.fid }'/>">${head.fname }</a></li>
					</c:forEach>

				</ul>
			</div>

			<div class="clearfix"></div>
		</div>
	</div>

</div>